<template>
  <div>
    <h2>计算属性</h2>
    <input type="text" v-model.lazy="xing">
    <input type="text" v-model.lazy="ming">
    <input type="text" v-model.lazy="fullName">
  </div>
</template>

<script>
export default {
  data () {
    return {
      xing: '张',
      ming: '三'
    }
  },
  computed: {
  
    fullName: {
      get () {
        return this.xing + ' ' + this.ming
      },
      set (value) {
        let arr = value.split(' ') 
        this.xing = arr[0]
        this.ming = arr[1]
      }
    }
  }
}
</script>

<style>

</style>